package edu.zju.gis.dldsj.type;

import java.util.ArrayList;
import java.util.List;

/**
 * @author yanlo yanlong_lee@qq.com
 * @version 1.0 2018/07/12
 * Comments 结构化数据中某一列的描述，可提供条件以供查询
 */
public class Column {
    StructField field;
    List<String> conditions;

    public Column(StructField field) {
        this(field, new ArrayList<>());
    }

    public Column(StructField field, List<String> conditions) {
        this.field = field;
        this.conditions = conditions;
    }

    public void add(String condition) {
        this.conditions.add(condition);
    }

    public String getConditionAsString() {
        return "(" + String.join(" and ", conditions) + ")";
    }
}
